/**Created by the LayaAirIDE*/
module view.dlg{
	export class YesNo extends ui.dlg.YesNoUI{
		private type:number;
		private consumeSecor:number;
		private day:number;
		private bugouY:number;
		constructor(type:number,consumeSecor:number,day:number){
			super();
			this.type = type;
			this.consumeSecor = consumeSecor;
			this.day = day;
			this.bugouY = this.bugou.y;
			this.showYesNo();
			this.fou.on(Laya.Event.CLICK,this,this.closeYes);
			this.guangbi.on(Laya.Event.MOUSE_DOWN,this,this.closeYes);
			this.shi.on(Laya.Event.CLICK,this,this.showYes);
		}
		closeYes():void{
			this.close();
		}
		showYes():void {
			let secor = PlayerModel.GetScore();
			if (secor < this.consumeSecor ){
				this.bugou.visible = true;
				//添加缓动效果
				let bianY = this.bugouY - 120
				Laya.Tween.to(this.bugou,{y:bianY,scaleX:1,scaleY:1},1000,Laya.Ease.backOut,Laya.Handler.create(this,this.hide));
				
				return;
			}else{
				CtrlManager.GetCtrl(CtrlNames.Sign).sendSetSignNum(this.type,this.day);
				this.close();
			}
		}
		showYesNo():void{
			this.yesText.text = "是否消耗" + this.consumeSecor + "积分补签";
			this.yesText.visible = true;
			this.bugou.visible = false;
		}
		hide():void {
			this.bugou.visible = false;
			this.bugou.y = this.bugouY;
		}
	}
}